setwd("E:/1.甲基化分析/ASM/ASM_snp-onlyWGS/motif_pre/enrichment_result_21166")
file=read.csv("21166_motif_enrichment.csv",head=T)

file[file$OR=="Inf",]$OR=10
library(ggplot2)
library(ggrepel)
file$group="nosig"
file[file$p.value<0.05,]$group="sig"
file$logpvalue=-log10(file$p.value)
ggplot(file,aes(y=OR,x=logpvalue,color=group))+geom_point(size=5)+scale_color_manual(values = alpha(c('black','red'),0.7))+
  labs(y="OR",x="-log10 (p-value)",title="TF enrichment")+
  theme_light()+geom_vline(xintercept = -log10(0.05),color="red",linetype="dashed")+geom_hline(yintercept = 1,color="red",linetype="dashed")+
  geom_text_repel(data=subset(file,file$p.value<0.05),aes(label=geneSymbol),size=5,box.padding = unit(0.5, "lines"),point.padding = unit(0.8, "lines"), segment.color = "black", show.legend = FALSE)
